let config = {};

const host = window.location.host;

const pathName = window.location.pathname;

const protocol = window.location.protocol;

let pathFolder = "";

if (pathName.includes("/html/")) {
  pathFolder = pathName.split("/html/")[0];
} else if (pathName.includes(".html")) {
  let strArr = window.location.pathname.split(".html")[0].split("/");

  strArr.pop();

  pathFolder = strArr.join("/");
} else {
  pathFolder = pathName;
}

const RootUrl = protocol + "//" + host;
if (process.env.NODE_ENV === "development") {
  // 129.64:20103/Web_TeacherGrow/
  //  129.1:8023
  let baseIP
  baseIP = "https://jdtest.aiedu100.com/government-affairs/"
  // baseIP = "http://192.168.129.155:10296/government-affairs/"
  // baseIP = "http://192.168.122.230:12101/government-affairs/"
  // baseIP = "http://edub.aiedu100.com/government-affairs/"


  config = {
    TokenProxy: baseIP+"",
    // TokenProxy:'http://47.115.20.102:10102',
    proxy:
      "http://192.168.2.202:7300/mock/5d7726e0ed0ccd1564c8df05/webCloudDev",
    BasicProxy: baseIP+"",
    EditorProxy: "/UEditor/",
    // LoginProxy: "http://192.168.129.64:20102",
    LoginProxy: "http://192.168.129.1:10103",
    ErrorProxy: "http://192.168.129.1:30103",
    HashPrevProxy: RootUrl,
    RootProxy: RootUrl,
  };
}

if (process.env.NODE_ENV === "production") {
  config = {
    // TokenProxy: "",

    // BasicProxy: "",
    // LoginProxy: "",

    // ErrorProxy: "",
    TokenProxy: "",
    // TokenProxy:'http://47.115.20.102:10102',
    proxy:
      "http://192.168.2.202:7300/mock/5d7726e0ed0ccd1564c8df05/webCloudDev",
    BasicProxy: RootUrl + '/government-affairs/',
    LoginProxy: RootUrl,
    EditorProxy: "/UEditor/",

    ErrorProxy: "http://192.168.129.1:30103",
    HashPrevProxy: RootUrl,
    RootProxy: RootUrl,
  };
  console.log = ()=>{}
}
window.BasicProxy = config.BasicProxy;
window.baseAddr = config.BasicProxy;
console.log(window.BasicProxy)
export default config;
